<?php
namespace PsiFramework\Classes\Model;

import("Classes.Model.Object");
import("Classes.Model.ModelInterface.IUser");

use \PsiFramework\Classes\Model\Object;
use \PsiFramework\Classes\Model\ModelInterface\IUser;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * The SessionUser class describes the information
 * for a user to store in session
 *
 * @package Model
 */
class SessionUser extends Object implements IUser
{

    protected /*int*/     $_id ;
    protected /*string*/  $_login;
    protected /*string*/  $_password;

    /**
     * SessionUser constructor
     *
     * @param     int        $id                the id (unique) of the user
     * @param     string    $login            the login of the user
     * @param     string    $password        the password of the user
     * @return     SessionUser     instance
     */
    public function __construct(
        /*int*/ $id=null,
        /*string*/ $login=null,
        /*string*/ $password=null
    )
    {
        $this->_id = $id ;
        $this->_login = $login ;
        $this->_password = $password;
    }

    /**
     * Getter for the member variable $id
     *
     * @return int    the id of the user
     */
    public function getId()
    {
        return $this->_id ;
    }

    /**
     * Setter for the member variable $id
     *
     * @param     int    $id    the id
     */
    public function setId($id)
    {
        $this->_id = $id ;
    }

    /**
     * Retourne le nom du user
     *
     * @return     string    the login of the user
     */
    public function getName()
    {
        return $this->_login ;
    }

    /**
     * Getter for the member variable $login
     *
     * @return     string    the login of the user
     */
    public function getLogin()
    {
        return $this->_login ;
    }

    /**
     * Setter for the member variable $login
     *
     * @param     string    $login    the login
     */
    public function setLogin($login)
    {
        $this->_login = $login ;
    }

    /**
     * Getter for the member variable $password
     *
     * @return     string    the passwouserthe user
     */
    public function getPassword()
    {
        return $this->_password ;
    }

    /**
     * Setter for the member variable $password
     *
     * @param     string    $password    the password
     */
    public function setPassword($password)
    {
        $this->_password = $password ;
    }

    /**
     * The toString function
     *
     * @return string
     */
    public function toString()
    {
        return $this->_login ;
    }
}
